package com.xbongbong.pro.formdata.pojo.vo;

import com.xbongbong.paas.domain.entity.PaasFormDataEntity;
import com.xbongbong.paas.domain.entity.ext.PaasFormEntityExt;
import com.xbongbong.paas.field.FieldAttrEntity;
import com.xbongbong.paas.toolbox.wrap.BaseVO;
import com.xbongbong.pro.formdata.pojo.SaasNeedRedundantAttrPojo;
import com.xbongbong.saas.domain.entity.WorkOrderEntity;
import com.xbongbong.saas.domain.entity.ext.WorkOrderFormEntityExt;
import lombok.Getter;
import lombok.Setter;
import lombok.ToString;

import java.util.List;
import java.util.Map;

/**
 * 保存之前校验的vo
 * @author 吴峰
 * @date 2020/12/30 16:20
 */
@Getter
@Setter
@ToString
public class BeforeSaveVO extends BaseVO {

    private static final long serialVersionUID = -8050356276254149604L;

    /**
     * 表单级实体
     */
    private PaasFormEntityExt paasFormEntityExt;
    /**
     * explain实体
     */
    private Map<String, FieldAttrEntity> explainMap;

    /**
     * 返回的数据实体，用于保存和返回给业务规则
     */
    private PaasFormDataEntity paasFormDataEntity;

    /**
     * 业务规则使用的explain，不要remove掉字段
     */
    private List<FieldAttrEntity> explainList;

    private SaasNeedRedundantAttrPojo saasNeedRedundantAttrPojo;

    /**
     * 1： 无需审批
     */
    private Integer noApprovalRequired;

    private WorkOrderFormEntityExt workOrderFormEntityExt;

    private WorkOrderEntity workOrderEntity;

    public BeforeSaveVO() {
    }


    public BeforeSaveVO(PaasFormEntityExt paasFormEntityExt, Map<String, FieldAttrEntity> explainMap, PaasFormDataEntity paasFormDataEntity,
                          List<FieldAttrEntity> explainList, SaasNeedRedundantAttrPojo saasNeedRedundantAttrPojo, Integer noApprovalRequired) {
        this.paasFormEntityExt = paasFormEntityExt;
        this.explainMap = explainMap;
        this.paasFormDataEntity = paasFormDataEntity;
        this.explainList = explainList;
        this.saasNeedRedundantAttrPojo = saasNeedRedundantAttrPojo;
        this.noApprovalRequired = noApprovalRequired;
    }




    public BeforeSaveVO(Map<String, FieldAttrEntity> explainMap, List<FieldAttrEntity> explainList, SaasNeedRedundantAttrPojo saasNeedRedundantAttrPojo, Integer noApprovalRequired, WorkOrderFormEntityExt workOrderFormEntityExt, WorkOrderEntity workOrderEntity) {
        this.explainMap = explainMap;
        this.explainList = explainList;
        this.saasNeedRedundantAttrPojo = saasNeedRedundantAttrPojo;
        this.noApprovalRequired = noApprovalRequired;
        this.workOrderFormEntityExt = workOrderFormEntityExt;
        this.workOrderEntity = workOrderEntity;
    }
}
